﻿<UserControl x:Class="LogoScriptIDE.WatchesWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	    xmlns:tree="clr-namespace:Aga.Controls.Tree;assembly=Aga.Controls"
        MinWidth="200" MinHeight="100">

    <UserControl.Resources>
        <DataTemplate x:Key="NameTemplate">
            <StackPanel Orientation="Horizontal">
                <tree:RowExpander/>
                <TextBlock Text="{Binding Name}"></TextBlock>
            </StackPanel>
        </DataTemplate>
    </UserControl.Resources>

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="30"/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>
        
        <StackPanel Orientation="Horizontal"
                    Grid.Row="0" Grid.Column="0">
            <Button Content="Add Watch" Margin="5" Click="ui_addVarClick" />
            <Button Content="Delete Watch" Margin="5" Click="ui_delVarClick" />
        </StackPanel>
        
        <tree:TreeList Name="ui_vartree"
                       AutoGenerateColumns="False"
                       CanUserSortColumns="False"
                       IsReadOnly="True"
                       Grid.Row="1" Grid.Column="0" Margin="5"
                       VerticalScrollBarVisibility="Visible"
                       CanUserResizeRows="False">
            <DataGrid.Columns>
                <DataGridTemplateColumn Header="Name" CellTemplate="{StaticResource NameTemplate}" />
                <DataGridTextColumn Header="Type" Binding="{Binding Type}"/>
                <DataGridTextColumn Header="Value" Binding="{Binding Value}"/>
                <DataGridTextColumn Header="Remark" Binding="{Binding Remark}"/>
            </DataGrid.Columns>
        </tree:TreeList>
    </Grid>
</UserControl>
